﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using Com.PhilChuang.Mobile.Apps.LocationSender.Ui.Views.Impl.ViewModels;
using Microsoft.Phone.Controls.Maps;

namespace Com.PhilChuang.Mobile.Apps.LocationSender.Ui.Views.Impl.Pages
{
	public sealed partial class SelectContactsPage : SelectContactsPageBase
	{
		#region Events
		public event Action DoSelectCoordsFormat = delegate { };
		public event Action DoLookUpNumber = delegate { };
		public event Action DoLookUpEmail = delegate { };
		#endregion

		#region Instance members (EMPTY)
		#endregion

		#region Properties (EMPTY)
		#endregion

		#region Constructors / Init
		public SelectContactsPage ()
		{
			InitializeComponent ();
			SetApplicationBarItems ();
		}
		#endregion

		#region Event handlers
		private void field_Contacts_KeyUp (object sender, System.Windows.Input.KeyEventArgs e)
		{
			ViewModel.RecipientsString = field_Contacts.Text;
		}

		private void field_Contacts_TextChanged (object sender, TextChangedEventArgs e)
		{
			ViewModel.RecipientsString = field_Contacts.Text;
		}

		private void g_btn_SelectFormat_Click (object sender, System.Windows.RoutedEventArgs e)
		{
			DoSelectCoordsFormat ();
		}

		private void g_btn_ChooseNumber_Click (object sender, System.Windows.RoutedEventArgs e)
		{
			DoLookUpNumber ();
		}

		private void g_btn_ChooseEmail_Click (object sender, System.Windows.RoutedEventArgs e)
		{
			DoLookUpEmail ();
		}
		#endregion

		#region Functionality (EMPTY)
		#endregion

		#region Private methods
		protected override Map MapControl { get { return g_Map; } }
		#endregion

		#region Utility methods
		#endregion
	}

	public class SelectContactsPageBase : AbstractLocationSenderAppPageBase<SelectContactsPageViewModel>
	{
		protected override Map MapControl { get { return null; } }
	}
}